package sdk.webview.fmc.com.fmcsdk.presenter;

import sdk.webview.fmc.com.fmcsdk.base.BaseData;
import sdk.webview.fmc.com.fmcsdk.base.BasePresenter;
import sdk.webview.fmc.com.fmcsdk.base.UserApi;
import sdk.webview.fmc.com.fmcsdk.interfaces.FristView;
import sdk.webview.fmc.com.fmcsdk.util.Url;
import sdk.webview.fmc.com.fmcsdk.util.retrofit2.observer.ResponseTransformer;
import sdk.webview.fmc.com.fmcsdk.util.retrofit2.subscriber.ResponseSubscriber;

/**
 * Created by ydm on 2019/4/10.
 */

public class FristPresenter extends BasePresenter<FristView> {

    public void getCrcResult() {
        getApi(UserApi.class).getCrcSize(getDefaultAddress()+ Url.GETCRCSIZE, Url.XMLHTTPREQUEST)
                .compose(new ResponseTransformer<>(this.<BaseData>bindToLifeCycle()))
                .subscribe(new ResponseSubscriber<BaseData>(view) {
                    @Override
                    public void success(BaseData baseData) {

                    }
                    @Override
                    public void onRequestAgain() {}
                });
    }
}
